package com.sky.item.service.es;


import org.elasticsearch.rest.RestStatus;

import java.io.IOException;
import java.util.List;

public interface DishServiceForES {

    /**
     * 通过name查询es
     * @param name
     * @return
     */
    public List<Long> searchByName(String name) throws IOException; //admin

    /**
     * 插入es数据
     *
     * @param id
     * @param name
     * @return
     */
    public RestStatus insert(Long id, String name) throws IOException;

    /**
     * 删除es数据
     *
     * @param id
     * @return
     */
    public RestStatus deleteById(Long id) throws IOException;

    /**
     * 修改es name
     *
     * @return
     */
    RestStatus updateById(Long id, String name) throws IOException;

    public Boolean deleteIndex(String indexName) throws IOException;

    public Boolean deleteAll(String indexName) throws IOException;

}
